#1.实现一个函数count(str,substr,[begin=0],[end=0]),查找str中有多少个substr,只以字符串为例
# def count(str,substr,begin=0,end=0):
#     a = str[begin:end].count(substr)
#     return a
#
# print(count("121dfdsfsf121",'121',end = 13))

#2.实现一个函数，支持传入任意多个整数进行加法运算，并返回结果
# def add(*args):
#     sum = 0
#     for i in args:
#         sum += i
#     return sum
# print(add(1,2,3,4,5))

#3.实现一个简易计算器，根据用户输入执行相应的加、减、乘、除运算，列如用户输入'9/3'得出结果。每种运算请用单独的函数处理
a = input("输入运算公式：")
def add(a):
    return (int(a[0])+int(a[2]))
def miuns(a):
    return (int(a[0])-int(a[2]))
def divison(a):
    return (int(a[0])/int(a[2]))
def mutily(a):
    return (int(a[0])*int(a[2]))

if a[1] == "+":
    print(add(a))
elif a[1] == "-":
    print(miuns(a))
elif a[1] == "*":
    print(mutily(a))
else:
    print(divison(a))